<template>
  <div class="basic_info">
    <div class="content">
      <!-- 头部 -->
      <div class="title">系统配置</div>
      <div class="activeBtn">
        <!-- <button class="btn basic" :class="{ Active: isActive === true  }" @click="handleBusiness">基本参数</button>
        <button class="btn" @click="handleBasic" :class="{ Active: isActive === false }">业务参数</button> -->
        <button class="btn basic" :class="isActive ? 'Active' : ''" @click="handleBusiness">基本参数</button>
        <button class="btn" @click="handleBasic" :class="isActive ? '' : 'Active'">业务参数</button>
      </div>
      <!-- <router-view></router-view> -->
      <BasicA ref="basicA" v-show="isActive"></BasicA>
      <Business ref="business" v-show="!isActive"></Business>
      <!-- <div class="resultCancel">
        <button class="handleResult" style="margin-right: 13px" @click="handleSave">保存</button>
        <button class="handleCancel">取消</button>
      </div> -->
    </div>
  </div>
</template>

<script>
import { getAction, postAction } from '@/api/manage'
import BasicA from '@/views/setting/basicBusiness/BasicA.vue'
import Business from '@/views/setting/basicBusiness/Business.vue'
import { ACCESS_TOKEN, TENANT_ID, ACCOUNT_BOOK } from '@/store/mutation-types'
import Vue from 'vue'
export default {
  name: 'setSystem',
  components: {
    BasicA,
    Business,
  },
  data() {
    return {
      isActive: true,
      systemBasicInfo: [],
      systemBusinessInfo: [],
      submitData: [],
      accountBookId: '',
    }
  },
  mounted() {
    let accountBook = Vue.ls.get(ACCOUNT_BOOK)
    this.accountBookId = accountBook && accountBook.id
    // 获取系统配置参数
    // this.getSystemInfo()
  },
  methods: {
    /**
     * 获取系统配置参数
     */
    async getSystemInfo() {
      const res = await getAction('/sysConfig/systemConfig/queryByXghAccountBookId', {
        xghAccountBookId: this.accountBookId,
      })
      if (res.code === 200) {
        if (res.result) {
          this.systemBasicInfo = res.result.sysConfigList
        }
      } else {
        return this.$elMessage.error(res.message)
      }
    },
    handleBusiness() {
      this.isActive = true
      this.$refs.basicA.edit()
    },
    handleBasic() {
      this.isActive = false
      this.$refs.business.edit()
    },
  },
}
</script>

<style lang="scss" scoped>
.basic_info {
  width: 100%;
  height: calc(100vh - 110px);
  background: #ffffff;
  box-sizing: border-box;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
}
.content {
  padding: 0 30px;
  margin-top: 10px;
  box-sizing: border-box;

  .activeBtn {
    display: flex;
    justify-content: center;
    margin-top: 16px;
  }
  .title {
    color: #1b94fb;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 30px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    font-family: PingFang SC;
  }
  .containerContent {
    display: flex;
    margin-top: 0.468779rem;
    justify-content: space-between;
    .one {
      width: 5.250328rem;
      &:last-child {
        margin-right: 1.406338rem;
      }
      .checkbox {
        margin-top: 10px;
        .lastCheckbox {
          padding-bottom: 10px;
          width: 100%;
          border-bottom: 1px solid #eeeeee;
        }
        .radio {
          margin-top: 10px;
        }
      }
      .infotitle {
        padding-bottom: 13px;
        font-size: 14px;
        font-family: PingFang SC;
        font-weight: 500;
        line-height: 22px;
        border-bottom: 1px solid #eee;
      }
    }
  }
}
::v-deep .el-checkbox__label {
  font-size: 12px;
}
.btn {
  background: #fff;
  border: none;
  color: #666666;
  font-size: 12px;
  border-radius: 5px;
  width: 80px;
  height: 30px;
  border: 1px solid #dddddd;
}
.basic {
  margin-right: 10px;
}
::v-deep .is-checked {
  color: #1a93fa;
}
.border-top {
  margin-top: 10px;
  border-top: 1px solid #eee;
}
.handleCancel,
.handleResult {
  width: 60px;
  height: 30px;
  font-size: 14px;
  color: #666666;
  border: 1px solid #dddddd;
  border-radius: 5px;
}
.handleResult {
  background: #1890ff;
  color: #fff;
}
.resultCancel {
  margin-top: 38px;
  text-align: center;
}
.Active {
  color: #fff;
  background-color: #1993fb;
}
</style>